#lang rosetta-racket


(require "random-graph-coords.rkt")

(provide line-boat
         silk-boat-example
         string-boat-example)


(define line-boat-vertices
  (vector
   (xyz 5 1 1)
   (xyz -5 1 1)
   (xyz -5 -1 1)
   (xyz 5 -1 1)
   (xyz 5 1 -1)
   (xyz -5 1 -1)
   (xyz -5 -1 -1)
   (xyz 5 -1 -1)
   (xyz 10 0 2.5)
   (xyz -10 0 2.5)))

(define line-boat-neighbours
  (vector
   '(1 3 4 8)
   '(0 2 5 9)
   '(1 3 6 9)
   '(0 2 7 8)
   '(0 5 7 8)
   '(1 4 6 9)
   '(2 5 7 9)
   '(3 4 6 8)
   '(0 3 4 7)
   '(1 2 5 6)))

(define (line-boat line-fn n)
  (line-fn
   (random-graph-coords line-boat-vertices line-boat-neighbours n)))

(define (silk-boat-example)
  (view
   (xyz -39.707841235991076 93.13924272980162 29.671054721501775)
   (xyz 5.493773875665906 -13.018467016415801 -3.916834060493839)
   (perspective 197)
   (line-boat spline 1000)))

(define (string-boat-example)
  (view
   (xyz -39.707841235991076 93.13924272980162 29.671054721501775)
   (xyz 5.493773875665906 -13.018467016415801 -3.916834060493839)
   (perspective 197)
   (line-boat line 1000)))